<?php
	if (!empty($products)) {?>
	<h3><?=__('products.index.title') ?></h3>

	<table>
		<tr>
			<th><?=__('products.name') ?></th>
			<th><?=__('products.catName') ?></th>
			<th><?=__('products.price') ?></th>
			<th><?=__('products.doc') ?></th>
			<th><?=__('products.dom') ?></th>
			<th><?=__('products.viewLink') ?></th>
		</tr>

		<?php
		foreach($products as $product) { ?>

		<tr>
			<td><?=$product['Product']['name']; ?></td>
			<td><?=$product['Category']['name']; ?></td>
			<td><?=$product['Product']['price']; ?></td>
			<td><?= date('d-m-Y', strtotime($product['Product']['created'])); ?></td>
			<td><?= date('d-m-Y', strtotime($product['Product']['modified'])); ?></td>
			<td><a href="/products/view/<?=$product['Product']['id']; ?>"><?=__('products.viewLink') ?></a></td>
		</tr>
		<?php }?>
	</table>


<?php } else {?>

	<p><?=__('products.index.noProduct')?></p>
<?php }?>